last_date = "1995.1.1"

tests = {

	soviet_design_anti_tank = {

         success = {
             date > "1939.1.1"
             date < "1955.1.1"
             SOV = { ai_has_role_template = anti_armor }
         }

         fail = {
             date > "1955.1.1"
         }
    }

	england_has_fallen = {
         success = {
             date > "1945.1.1"  
         }

         fail = {
             date < "1945.1.1"
             ENG = {  
                OR = { 
                    has_capitulated = yes 
                    is_subject = yes
                    exists = no
                }
            }
         }
    }
	
	sov_design_garrison = {

         success = {
             date > "1939.1.1"
             date < "1945.1.1"
             SOV = { ai_has_role_template = garrison }
         }

         fail = {
             date > "1941.1.1"
         }
    }
	
	#sov_fields_garrison = {
#
   #      success = {
   #          date > "1939.1.1"
   #          date < "1945.1.1"
   #          SOV = { ai_has_role_division = garrison }
   #      }
#
   #      fail = {
   #          date > "1941.1.1"
   #      }
   # }
	
	germany_has_medium_armor = {
		success = {
             date > "1936.1.1"
             date < "1955.1.1"
             GER = { 
				has_equipment = {
					medium_tank_chassis > 0
				}
			}
         }

         fail = {
             date > "1955.1.1"
         }

        loggers = {

            log_equipment_in_field = {
                country = GER
                value = medium_tank_chassis
            }

        }
	}
	
	germany_has_medium_armor_design = {
		success = {
             date > "1936.1.1"
             date < "1955.1.1"
             GER = { 
				has_template_majority_unit = medium_armor
			}
         }

         fail = {
             date > "1955.1.1"
         }
	}	
	
	soviet_has_medium_armor = {
        acceptable_fail_rate = 0.2
		success = {
             date > "1936.1.1"
             date < "1955.1.1"
             SOV = { 
				has_equipment = {
					medium_tank_chassis > 0
				}
			}
         }

         fail = {
             date > "1955.1.1"
         }
	}
	
	soviet_has_medium_armor_design = {
		success = {
             date > "1936.1.1"
             date < "1955.1.1"
             SOV = { 
				has_template_majority_unit = medium_armor
			}
         }

         fail = {
             date > "1955.1.1"
         }
	}
	
	usa_has_medium_armor = {
        acceptable_fail_rate = 0.3
		success = {
             date > "1936.1.1"
             date < "1955.1.1"
             USA = { 
				has_equipment = {
					medium_tank_chassis > 0
				}
			}
         }

         fail = {
             date > "1955.1.1"
         }
	}
	
	usa_has_medium_armor_design = {
		success = {
             date > "1936.1.1"
             date < "1955.1.1"
             USA = { 
				has_template_majority_unit = medium_armor
			}
         }

         fail = {
             date > "1955.1.1"
         }
	}


    ROM_joined_GER = {
         success = {
             date > "1936.1.1"
             date < "1943.1.1"
             ROM = {  
                is_in_faction_with = GER
            }
         }

         fail = {
             date > "1942.1.1"
         }
    }

    HUN_joined_GER = {
         success = {
             date > "1936.1.1"
             date < "1943.1.1"
             HUN = {  
                is_in_faction_with = GER
            }
         }

         fail = {
             date > "1942.1.1"
         }
    }

    allies_should_not_fight_china = {
         success = {
            CHI = { 
                OR = { #dumb scoping because testing assumes some kind of ok top scope for checks
                    date > 1944.1.1
                    is_in_faction_with = JAP 
                }
            }
         }

         fail = {
             CHI = { 
                has_war_with = ENG 
                NOT = { is_in_faction_with = JAP }
            }            
         }
    }

    nationalist_spain_wins = {
        acceptable_fail_rate = 0.15
        success = {
            has_global_flag = scw_over
            has_global_flag = nationalist_victory
        }

        fail = {
            has_global_flag = scw_over
            has_global_flag = republican_victory
        }
    }

    no_carlist_spain_rising_up = {
        acceptable_fail_rate = 0.15
        success = {
            has_dlc = "La Resistance"
            has_global_flag = scw_over
        }

        fail = {
            has_dlc = "La Resistance"
            SPB = { exists = yes }
        }
    }

    FRA_vichy_not_communist = {
        success = {
            date > "1948.1.1"
        }
        fail = {
            date < "1948.1.2"
            any_country = {
                original_tag = FRA
                is_subject_of = GER
                has_government = communism
            }
        }
    }
    FRA_vichy_communist_support_above_50 = {
        success = {
            date > "1948.1.1"
        }
        fail = {
            date < "1948.1.2"
            any_country = {
                original_tag = FRA
                is_subject_of = GER
                communism > 0.5
            }
        }
    }
    GER_leave_sweden_alone_exclamation_mark = {
        acceptable_fail_rate = 0.15
        success = {
            date > "1945.1.1"
        }
        fail = {
            date < "1945.1.2"
            GER = {
                has_war_with = SWE
            }
        }
    }

    UK_holds_on_to_suez = {
        acceptable_fail_rate = 0.3

        success = {
            date > "1945.1.1"
        }
        fail = {
            date < "1945.1.2"
            446 = {
                NOT = { is_controlled_by = ENG }
            }
        }
    }

    US_went_commie = {
        acceptable_fail_rate = 0.25

        success = {
            date > "1945.1.1"
        }
        fail = {
            date < "1945.1.2"
            USA = {
                has_government = communism
            }
        }
    }
    US_went_fascho = {
        acceptable_fail_rate = 0.25

        success = {
            date > "1945.1.1"
        }
        fail = {
            date < "1945.1.2"
            USA = {
                has_government = fascism
            }
        }
    }
    US_return_of_the_king = {
        acceptable_fail_rate = 0.1

        success = {
            date > "1945.1.1"
        }
        fail = {
            date < "1945.1.2"
            USA = {
                has_government = neutrality
            }
        }
    }

    TUR_kurdish_uprising = {
        acceptable_fail_rate = 0.1
        success = {
            date > "1945.1.1"
        }
        fail = {
            date < "1945.1.2"
            country_exists = KUR
			KUR = {
				is_subject = no
			}
        }
    }

    TUR_has_fallen_too_early = {
        acceptable_fail_rate = 0.1
        success = {
            date > "1944.1.1"
        }
        fail = {
            date < "1944.1.2"
            TUR = { has_capitulated = yes }
        }
    }

    BUL_has_fallen_too_early = {
        acceptable_fail_rate = 0.1
        success = {
            date > 1944.1.1
        }
        fail = {
            date < 1944.1.2
            BUL = { has_capitulated = yes }
        }
    }

    BUL_zveno_coup = {
        acceptable_fail_rate = 0.1
        success = {
            date > 1945.1.1
        }
        fail = {
            date < 1945.1.2
            any_country = {
                original_tag = BUL
                has_country_flag = BUL_zveno_bulgaria_Flag
            }
        }
    }

    BUL_fatherland_front_coup_too_early = {
        acceptable_fail_rate = 0.1
        success = {
            date > 1944.6.1
        }
        fail = {
            date < 1944.6.2
            has_global_flag = BUL_fatherland_front_coup_flag
        }
    }

    england_has_stanley_baldwin_as_leader = {
         success = {
             date > "1936.1.2"
         }

         fail = {
            date < "1936.1.2"
            NOT = { 
                ENG = {  
                    has_country_leader = {
                        name= "Stanley Baldwin"
                    }
                }
            }
         }
    }

    US_factory_50_test_1940 = { # at least 50 factories in 1940
        success = {
             date > "1940.1.1"
             date < "1955.1.1"
             USA = { 
                num_of_military_factories > 49
            }
         }

         fail = {
             date > "1941.1.1"
         }
    }

     US_factory_100_test_1941 = { # at least 100 factories in 1941
        success = {
             date > "1941.1.1"
             date < "1955.1.1"
             USA = { 
                num_of_military_factories > 99
            }
         }

         fail = {
             date > "1942.1.1"
         }
    }

     US_factory_150_test_1942 = { # at least 150 factories in 1942
        success = {
             date > "1942.1.1"
             date < "1955.1.1"
             USA = { 
                num_of_military_factories > 149
            }
         }

         fail = {
             date > "1943.1.1"
         }
    }  
     US_factory_200_test_1943 = { # at least 200 factories in 1943
        success = {
             date > "1943.1.1"
             date < "1955.1.1"
             USA = { 
                num_of_military_factories > 199
            }
         }

         fail = {
             date > "1944.1.1"
         }
    } 

   ENG_factory_50_test_1940 = { # at least 50 factories in 1940
        success = {
             date > "1940.1.1"
             date < "1955.1.1"
             ENG = { 
                num_of_military_factories > 49
            }
         }

         fail = {
             date > "1941.1.1"
         }
    }

     ENG_factory_75_test_1941 = { # at least 75 factories in 1941
        success = {
             date > "1941.1.1"
             date < "1955.1.1"
             ENG = { 
                num_of_military_factories > 74
            }
         }

         fail = {
             date > "1942.1.1"
         }
    }

     ENG_factory_100_test_1942 = { # at least 100 factories in 1942
        success = {
             date > "1942.1.1"
             date < "1955.1.1"
             ENG = { 
                num_of_military_factories > 99
            }
         }

         fail = {
             date > "1943.1.1"
         }
    }  
     ENG_factory_125_test_1943 = { # at least 125 factories in 1943
        success = {
             date > "1943.1.1"
             date < "1955.1.1"
             ENG = { 
                num_of_military_factories > 124
            }
         }

         fail = {
             date > "1944.1.1"
         }
    }

     EST_has_gone_fascist = { # 
        success = {
             date > "1942.1.1"
         }

         fail = {
            date < "1942.1.1"
            EST = { has_government = fascism }
         }
    }
    baltic_country_formed_faction = { # 
        success = {
             date > "1942.1.1"
         }

         fail = {
            date < "1942.1.1"
            OR = {
                EST = { is_faction_leader = yes }
                LIT = { is_faction_leader = yes }
                LAT = { is_faction_leader = yes }
            }
         }
    }

    poland_has_civil_war = { # we'll just assume that Poland after 1942 is conquered or we don't care
        success = {
             date > "1942.1.1"
         }

         fail = {
            date < "1942.1.1"
            POL = {
                has_civil_war = yes
            }
         }
    }

	SOV_should_not_fight_allies_this_early = {
         success = {
             date > "1945.1.1"  
         }

         fail = {
             date < "1945.1.1"
             SOV = {
				OR = {
					has_war_with = ENG
					has_war_with = USA
				}
			 }
         }
    }
	
	SOV_is_upgrading_manpower_law = {
         success = {
             date > "1943.1.1"
         }

         fail = {
             date > "1942.6.1"
             SOV = {
				OR = {
					has_idea = volunteer_only
					has_idea = limited_conscription
				}
			 }
         }
    }
	
}
